package jdbc;/*
 *
 * @author 陈粒
 * @version 创建时间：2021/7/30 16:20
 */

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBC02_ExecuteUpdate {
    public static void main(String[] args) throws SQLException {
        //1.获取数据库连接对象
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/teacher", "root", "root");
        //2.定义sql语句
        String sql1 = "INSERT INTO teachers VALUES(1,null,null,null,null,null)";
        //3.获取传输器
        Statement stmt = conn.createStatement();
        int count = stmt.executeUpdate(sql1);
        System.out.println(count);
        stmt.close();
        conn.close();
    }
}
